// 纯粹的工具

// 移除Object中空值的key
export function trimObj(obj) {
  for (const key in obj) {
    if (obj.hasOwnProperty(key)) {
      if (obj[key] === null || obj[key] === '' || obj[key] === undefined) {
        delete obj[key]
      }
    }
  }

  return obj
}

// 设置浏览器窗口标题
export const setTitle = (title) => {
  document.title = title || ''
}

export function isEmptyStr(content) {
  return undefined === content || null === content || '' === content
}

export function isEmptyObj(obj) {
  return obj === undefined || obj === null || JSON.stringify(obj) === '{}'
}
